<!DOCTYPE html>
<html>
    <head>
        <title>for in 和 this关键字  </title>
		<meta charset="utf-8" />
    </head>
    <body>

    </body>
    <script>
        var movie = {
            movieName: "长津湖",
            duration: 176,
            price: 50,
            showTime: function(){
                console.log(this);
                console.log(this.movieName + "2021-10-01 14:00");
            }
        }
        
        //for in 会遍历取出对象的属性值
        //可以 对象[k]
        for(var k in movie){
            console.log(k);
            //console.log(movie.k);
        }

        //方法的this会指向该方法的调用主体
        //谁调用的这个方法，this就指向谁
        movie.showTime();
    </script>
</html>